package com.tanhua.model.vo;

import com.tanhua.model.domain.Questions;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.util.List;

/**
 * @author pc
 * @date 2021/11/27
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class QuestionsVo {
    String id;//试题编号
    String question;//题目
    List<OptionsVo> options;
    public static QuestionsVo init(Questions questions,List<OptionsVo> optionsVos) {
        QuestionsVo vo = new QuestionsVo();
        BeanUtils.copyProperties(questions,vo);
        vo.setId(questions.getId().toString());
        vo.setOptions(optionsVos);
        return vo;
    }
}
